Skip to main content

Update Knowledge

Used to update an existing knowledge base entry. This allows you to modify the content of files, text, Q&A pairs, or other knowledge types that have already been added to the knowledge base.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/kb/update

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/kb/update' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"project_key": "YOUR_PROJECT_KEY",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "qa",
"kb_id": "kb_12345",
"content": "To reset your password, navigate to Settings > Security > Change Password. Enter your current password, then your new password twice for confirmation. Click Save to complete the process.",
"question": "How do I reset my password?"
}'

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"project_key": "string",
"agent_id": "string",
"type": "file",
"kb_id": "string",
"content": "string",
"question": "string"
}

Request Body Parameters

FieldTypeRequiredDescription
project_keystringYesThe project key for your project.
agent_idstringYesUUID of the AI agent associated with the knowledge entry.
typestringYesType of knowledge entry (e.g., file, text, qa, link).
kb_idstringYesUnique identifier of the knowledge base entry to update.
contentstringNoUpdated content for text-based entries or answer in Q&A pairs.
questionstringNoUpdated question text (only applicable for Q&A type entries).
note

Field Requirements by Type

  • For text type: Only content is required
  • For qa type: Both question and content (answer) are required
  • For file type: Update operations may vary based on implementation
  • For link type: content may represent the updated URL
tip

After updating a knowledge entry, the system will automatically:

  • Re-process the updated content
  • Re-generate embeddings for the new content
  • Update the vector index
  • Make the updated information available for retrieval

Response

Success Response (200 OK)

Returns an object containing the update status.

{
"is_success": true,
"detail": "Knowledge entry updated successfully",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the update was successful.
detailstringSuccess or failure message with additional context.
errorobjectError details if the operation failed (empty if successful).

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"kb_id"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
400Bad Request - Invalid update dataBad Request
404Not Found - Knowledge entry does not existNot Found
422Validation Error - Invalid request parametersUnprocessable Entity